#!/bin/bash
#echo "$2 $1 状态被激活，请确认HAProxy服务运行状态"|mail -s "HAProxy状态切换警告" $3
#echo "$2 $1 状态被激活，请确认HAProxy服务运行状态"
#$hostip
#$hostip={`curl www.icanhazip.com`}
hostiip='0.0.0.0'
hostiip=`curl www.icanhazip.com `
outip=`ifconfig|grep "inet addr:"|grep -v "127.0.0.1"|cut -d: -f2|awk '{print $1}'`
echo $hostiip
asdf="Administrators:<br>\
    </br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Intranet Ip address: $outip;\
    </br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extranet Ip address: $hostiip;\
    </br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$2 $1 is active!\
    </br>$4"
title='Status Monitoring'
#echo $asdf|mail -s "state" $3
#echo $asdf|mail -a 'Content-Type: text/html' -s "state" $3
echo $asdf|mutt -e 'set content_type="text/html"' -s "$title" $3
